﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FoxFoot : MonoBehaviour {
	FoxControl fox;
	void OnTriggerEnter2D(Collider2D other)
	{
		if(other.tag==Tag.ground)
		{
			fox.IsGround=true;
		}
        if (other.tag == Tag.enermy)
        {
            other.GetComponent<BaseEnermy>().HP--;
        }
	}
	void OnTriggerExit2D(Collider2D other)
	{
		if(other.tag==Tag.ground)
		{
			fox.IsGround=false;
		}
	}

	void Start()
	{
		fox=GameObject.FindGameObjectWithTag("Player").gameObject.GetComponent<FoxControl>();
	}

}
